/*
 * @Description: 商品详情
 * @Author: Kerwin
 * @Date: 2025-06-03 11:41:43
 * @LastEditTime: 2025-06-03 14:41:11
 * @LastEditors:  Please set LastEditors
 */

import { defineStore } from 'pinia'

export const useGoodsDetailStore = defineStore('goodsDetail', {
  state: () => ({
    goodsItem: null as any, // 当前商品信息
    details: null as any, // 商品小料
    productChoose: false, // 是否有规格
    orderId: '' //订单id
  }),
  actions: {
    setGoodsItem(item: any) {
      this.goodsItem = item
    },
    setDetails(details: any) {
      this.details = details
    },
    setProductChoose(flag: boolean) {
      this.productChoose = flag
    },
    setOrderId(data: any) {
      this.orderId = data
    }
  },
  persist: true
})

export default useGoodsDetailStore
